<?php
/**
 * Description: 修复图片脚本
 * Created by PhpStorm.
 * User: 玉坤
 * Date: 2021/9/9
 * Time: 14:04
 */

use Biz\model\wikiBrandAccount\BrandShop;
use Hhzbeads\Img\ImageType;
use Hhzbeads\Img\ImgUrl;

ini_set('display_errors', 1);
error_reporting(E_ALL ^ E_NOTICE ^ E_WARNING ^ E_DEPRECATED);
ini_set('memory_limit', '1024M');

//require_once '/data/wwwroot/g_vendor/autoload.php';



$map = file_get_contents("map.json");
$old_area = file_get_contents("old_area.json");
$oldCodeVsNewCode = file_get_contents("oldCodeVsNewCode.json");

$oldCodeVsNewCodeArr = json_decode($oldCodeVsNewCode,1);
$oldAreaArr = json_decode($old_area,1);
$mapArr = json_decode($map,1);

$other = [];
foreach ($oldAreaArr as  $item) {
    if ($item['pid'] == 35){
        continue;
    }
    if (!isset($mapArr[$oldCodeVsNewCodeArr[$item['lid']]])){
        $other[] =
            [
                'code' => $item['lid'],
                'name' => $item['name'],
            ];
    }
}
echo "</pre>";
print_r($other);
echo "</pre>";
die();


$other = json_encode($other, JSON_THROW_ON_ERROR | JSON_UNESCAPED_UNICODE);
file_put_contents("./other.json",$other);
